<template>
  <div class="notice-content">
    <div class="noticelist" v-for="(item,index) in items" :key="index">
      <div class="jiushibox">
        <h1 class="tit">{{ item.title }}</h1>
        <div class="timebox">
          <p>{{ item.addtime }}</p>
          <!-- <p>{{ item.num }}人已读</p> -->
        </div>
        <div class="noticedesc">
          <p>{{ item.concent }}</p>
          <div>
          <img :src="item.img"  mode="widthFix" style="height:2rem">
        </div>
        </div>
        
        <div v-if="item.replyConcent">商家回复：{{ item.replyConcent }}</div>
      </div>
    </div>
    <div class="noimg" v-if="show">
      <img src="@/assets/img/none.png">
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      show: false,
      items: []
    };
  },
  beforeCreate: function() {
    //创建前
  },
  created: function() {
    this.Suk_getlist();
    //创建后
  },
  beforeMount: function() {
    //挂载前
  },
  mounted: function() {
    //挂载后
  },
  beforeUpdate: function() {
    //更新前
  },
  update: function() {
    //更新后
  },
  methods: {
    Suk_getlist() {
      let that = this;
      that.$toast.loading({
        message: "加载中..."
      });
      var Sukdata = {
        // userId: localStorage.getItem("userid"),
        dinId: localStorage.getItem("storeid"),
        pageSize: 200
      };
      console.log(Sukdata);
      that.axios
        .post(
          that.baseUrl + "/evaluate/queryEvalua",
          that.Qs.stringify(Sukdata),
          {
            headers: {
              "Content-Type": "application/x-www-form-urlencoded"
            }
          }
        )
        .then(function(res) {
          if (res.request.status === 200) {
            if (res.data.meta.code == 200) {
              if (res.data.data.list.length == 0) {
                (that.items = []), (that.show = true);
                that.$toast.clear();
              } else {
                that.items = res.data.data.list;
                console.log(res.data);
                that.$toast.clear();
              }
            } else if (res.data.meta.code == 501) {
            }
          }
        });
    },
    recomment(index) {
      let that = this;
      console.log(that.items[index]);
      this.$router.push({
        name: "recomment",
        params: {
          commentid: that.items[index].evaluateId
        }
      });
    }
  }
};
</script>
<style lang="scss" scoped>
.notice-content {
  font-size: 0.3rem;
  background: #f0f0f0;
  padding-bottom: 15rem;
}

.jiushibox {
  width: 90%;
  margin: 0 auto;
  .tit {
    font-weight: 500;
    font-size: 0.5rem;
  }
  .timebox {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
    p {
      display: inline-block;
      margin-bottom: 0.1rem;
    }
  }
  .noticedesc {
    margin-top: 0.1rem;
    line-height: 0.6rem;
    padding-bottom: 0.1rem;
    border-bottom: 1px solid #f0f0f0;
  }
  .removebtn {
    text-align: right;
    margin-top: 0.1rem;
    span {
      display: inline-block;
      width: 1.8rem;
      height: 0.7rem;
      line-height: 0.7rem;
      color: #fff;
      text-align: center;
      background: #fe9a0f;
      border-radius: 0.1rem;
    }
  }
}

.noticelist {
  background: #fff;
  padding-bottom: 0.1rem;
  margin-bottom: 0.3rem;
  // box-shadow: 0rem 0.1rem 0.5rem 0.01rem #9e9e9e
}

.noimg {
  width: 100%;
  img {
    width: 100%;
  }
}
</style>
